package tech.aistar.day02;

/**
 * 本类用来演示: bean的生命周期
 *
 * @author: success
 * @date: 2021/5/7 9:11 上午
 */
public class Beans {
    private String name;

    public void setName(String name) {
        System.out.println("setter...");
        this.name = name;
    }

    public Beans(){
        System.out.println("bean的构造函数...");
    }

    public void init(){
        System.out.println("init...");
    }

    public void destroy(){
        System.out.println("destroy...");
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Beans{");
        sb.append("name='").append(name).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
